package main

import (
	"RPC/kitex_gen/payment"
	"RPC/kitex_gen/payment/payservice"
	"context"
	"fmt"
	"github.com/cloudwego/kitex/client"
	"log"
)

func main() {
	cli, err := payservice.NewClient("payment",
		client.WithHostPorts("127.0.0.1:8888"),
	)
	if err != nil {
		log.Fatal(err)
	}
	payReq := &payment.PayReq{
		Item:  "书包",
		Price: 100,
	}
	payResp, err := cli.Pay(context.Background(), payReq)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(payResp.PayRes)
}
